
export default {
	base:"http://120.25.145.214/tss/",
	getSignObj: () => {
		return localStorage.signObj ? JSON.parse(localStorage.signObj) : {};
	},
	setSignObj: (value) => {
		 let newObj = localStorage.signObj ? JSON.parse(localStorage.signObj) : {};
		 console.log(newObj)
		 newObj[value] = true;
		 localStorage.signObj = JSON.stringify(newObj);
	},
	postBody:(json)=>{
		if(typeof json=="object"){
			let result='';
			for(var i in json){
				result+=i+"="+json[i]+"&"
			}
			return result.substring(0,result.length-1);
		}
	},
	changeDate:(timestring,time)=>{
		if(typeof timestring==='number'||timestring.indexOf('-')=='-1'){
			let tt=new Date(parseInt(timestring))
			time===2?
			tt=tt.toString().substring(16,25)
			:
			tt=tt.toLocaleString().replace(/\//g, "-").replace(/下|上/g," ").substring(0,10)
			return tt;	
		}else{
			const ts = Date.parse(new Date(parseInt(timestring)));
			return ts;
		}
		
	},
}

